package factory

import (
	"go.mongodb.org/mongo-driver/bson/primitive"
	"time"
)

type User struct {
	ID          primitive.ObjectID `json:"-" bson:"_id,omitempty"`
	AccessToken string             `json:"access_token" bson:"-"`
	NickName    string             `json:"nick_name" bson:"nick_name"`
	Account     string             `json:"account,required" bson:"account,required"`
	Password   string    `json:"password" bson:"password"`
	Data       UserData  `json:"data" bson:"data"`
	Status     Status    `json:"-" bson:"status"`
	Logger     []logger  `json:"log" bson:"-"`
	CreateTime time.Time `json:"create_time" bson:"create_time"`
}

type UserData struct {
	RealName    string   `json:"real_name" bson:"real_name"`
	MailAddress string   `json:"mail_address" bson:"mail_address"`
	Position    string   `json:"position" bson:"position"` // 职位
	Auth        []string `json:"auth" bson:"auth"`         // 表CRUD:
}
